﻿// ********************************************
// ClassName  ：  AutoMapperHelper.cs
// Author        ：
// Company     ： 智测心控
// Version        ：V1.0
// CreateTime ： {date}
// Description ：
// ********************************************

using AutoMapper;

namespace Common.AutoMapperProfile
{
    /// <summary>
    /// AutoMapper帮助类
    /// </summary>
    public static class AutoMapperHelper
    {
        /// <summary>
        /// 映射对象
        /// </summary>
        public static IMapper Mapper { get; private set; }

        /// <summary>
        /// 初始化AutoMapper
        /// </summary>
        public static void AutoMapperInit()
        {
            var mapperConfiguration = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile<MapperConfigurationProfile>();
            });

            Mapper = mapperConfiguration.CreateMapper();
        }
    }
}